# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test05
# Description:
# Author:       98745
# Date:         2019/4/20
#-------------------------------------------------------------------------------
from pymysql import *

def dbconnect():
    db=connect('localhost','root','1997','scott',charset='utf8')
    return db

db=dbconnect()

def select(db):
    cursor=db.cursor()
    sql='''select * from dept;'''
    cursor.execute(sql)
    results=cursor.fetchall()
    print(results)

select(db)

